New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to specify "rvmrc" as rvm_ruby_string #4
Conversation
shell = "rvm_path=#{rvm_path} #{shell} --path '#{release_path}'" | ||
when "rvmrc" | ||
ruby = File.read('.rvmrc').gsub(/^rvm\s+/, "").strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did I understood this correctly - read the file and assume it contains only:
rvm 1.9.3
This is unfortunate assumption as there can be a lot more, better approach would be:
ruby=`rvm rvmrc load . >/dev/null; rvm current`
but this goes to be equal to current ruby:
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")
which could be extracted to:
set :rvm_ruby_string, :local
and :local
=> ENV['GEM_HOME'].gsub(/.*\//,"")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - sorry, didn't really know it can contain much more - never used it for that.
Lets then use your proposal with naming it "local" and using the ENV. :)
Shall I update the pull request accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please, do you think anyone will want to deploy application from different ruby/gemset then the strored in .rvmrc - or other from the new project file formats ? -> https://rvm.beginrescueend.com/workflow/projects/#ruby-versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never used gemsets as I always use bundler. I think there's no reason and it's bad pratice to use a different ruby locally than remote and hope nobody does it. So I think we don't have to take this into account.
@gucki any progress on updating the pull request? |
/me subscribing |
Sorry for the long delay - it's finally updated :) |
looks good, i was thinking on safeguards to protect from empty |
It's safe guarded now :) |
Add ability to specify "rvmrc" as rvm_ruby_string
@gucki it's perfect, thank you very much! <3 I will release rvm-capistrano 1.2.1 a bit later today. |
1.2.1 is released |
Great, thanks! :) |
I just hit some (minor) problem: even inside a small team it seems likely that different patch levels of the same ruby are used. The same is true for the production system. But right now we supply the full ruby version including the patch level, which makes it impossible to deploy from a system using ruby-1.9.3-p194 on a server using ruby-1.9.3-p125. I'd like to supply another patch/ pull request which removes the patch level from the ruby string to be used. Something like |
@gucki I would recommend your team to explicitly specify the patchlevel in your .rvmrc files. Patchlevel releases differ more than most people know. |
It's not an easy task to make sure that server uses the same patchlevel as all the devs. And I've never had any problems switching from one patch level to another. Even heroku says http://blog.heroku.com/archives/2012/5/9/multiple_ruby_version_support_on_heroku/:
|
...and certain patchlevels of Ruby 1.8.7 broke the MongoDB drivers, for example. These things happen, and I still think it makes sense that I was sure that this change was to make it easier for people that do specify patchlevel as they wouldn't have to duplicate this in both |
the problem with |
No description provided.